home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / winter_challenge.swf / scripts / frame_115 / PlaceObject2_244_124 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2011-08-19  |  1KB  |  32 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.gameInProgress == 1)
  3.    {
  4.       rot = Math.atan2(_root.ATVclip._y - this._y,_root.ATVclip._x - this._x);
  5.       rotNum = rot * 360 / 6.283185307179586;
  6.       this._rotation = rotNum;
  7.       i++;
  8.       if(i > 10 + random(50) && _root.gameInProgress == 1)
  9.       {
  10.          _root.ball._visible = 1;
  11.          duplicateMovieClip(_root.ball,"newball2",16384 + (8100 + i));
  12.          var hyp = 35;
  13.          _root.newball2.pathRadius = 35;
  14.          _root.newball2.degrees = rotNum;
  15.          with(Math)
  16.          {
  17.             radians = _root.newball2.degrees * (PI / 180);
  18.             yCoor = hyp * Math.sin(radians);
  19.             xCoor = hyp * Math.cos(radians);
  20.          }
  21.          _root.newball2._x = this._x + xCoor;
  22.          _root.newball2._y = this._y + yCoor;
  23.          _root.newball2.targetX = _root.ATVclip._x;
  24.          _root.newball2.targetY = _root.ATVclip._y;
  25.          i = 1;
  26.          _root.CANNON_F.start(0,0);
  27.          this.play();
  28.          _root.ball._visible = 0;
  29.       }
  30.    }
  31. }
  32.